package com.aspose.cells;

import java.util.ArrayList;

class zry extends zbz {
   private short a;

   zry() {
      this.c(255);
      this.a = 8;
   }

   void a(zqa var1, ArrayList var2) throws Exception {
      int var3 = var2.size() * 8 + 2;
      int var4 = 0;
      int var5;
      if (var3 > 8224) {
         var5 = 8222 / this.a;
         var3 = var5 * this.a;

         for(int var8 = 0; var8 < var2.size(); ++var8) {
            if (var8 == 0) {
               this.c = new byte[var3];
               this.c[0] = (byte)this.a;
               var4 = 2;
            } else if (var8 % var5 == 0) {
               var1.a(this.f());
               var1.b(this.c.length);
               var1.a(this.c, this.c.length);
               int var7 = 2 + this.a * (var2.size() - var8);
               if (var7 <= 8224) {
                  this.c = new byte[var7];
               } else {
                  this.c = new byte[var3];
               }

               this.c[0] = (byte)this.a;
               var4 = 2;
            }

            zarn var9 = (zarn)var2.get(var8);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var9.a), 0, this.c, var4, 4);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var9.b), 0, this.c, var4 + 4, 2);
            var4 += 8;
         }

         if (var4 != 2) {
            var1.a(this.f());
            var1.b(this.c.length);
            var1.a(this.c, this.c.length);
         }

      } else {
         this.c = new byte[var3];
         this.c[0] = (byte)this.a;
         var4 = 2;

         for(var5 = 0; var5 < var2.size(); ++var5) {
            zarn var6 = (zarn)var2.get(var5);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var6.a), 0, this.c, var4, 4);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var6.b), 0, this.c, var4 + 4, 2);
            var4 += 8;
         }

         var1.a(this.f());
         var1.b(var3);
         var1.a(this.c, this.c.length);
      }
   }
}
